package com.hk.web.dto;

import com.google.gson.Gson;
import com.hk.commons.domain.entity.IdEntity;
import com.hk.commons.enums.AuthMenuType;
import com.hk.web.domain.entity.AuthMenuItem;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.util.List;

/**
 * Created by Antinomy on 17/7/25.
 */
public class AuthMenuItemDTO {
    @ApiModelProperty(value = "主健ID")
    private Long id;

    @ApiModelProperty(value = "唯一ID")
    private String uniqueId;

    @ApiModelProperty(value = "唯一ID")
    private String rootUniqueId;

    @ApiModelProperty(value = "名称")
    private String label;

    @ApiModelProperty(value = "路由地址")
    private String router;

    @ApiModelProperty(value = "菜单类型")
    @Enumerated(EnumType.STRING)
    private AuthMenuType menuType;

    @ApiModelProperty(value = "父菜单Id")
    private Long parentId;

    @ApiModelProperty(value = "名称")
    private String icon;

    private List<AuthMenuItemDTO> children;
    private List<String> buttons;

    public AuthMenuItemDTO(){}

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public String getRouter() {
        return router;
    }

    public AuthMenuType getMenuType() {
        return menuType;
    }

    public String getUniqueId() {
        return uniqueId;
    }

    public void setUniqueId(String uniqueId) {
        this.uniqueId = uniqueId;
    }

    public String getRootUniqueId() {
        return rootUniqueId;
    }

    public void setRootUniqueId(String rootUniqueId) {
        this.rootUniqueId = rootUniqueId;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public void setRouter(String router) {
        this.router = router;
    }

    public void setMenuType(AuthMenuType menuType) {
        this.menuType = menuType;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public List<AuthMenuItemDTO> getChildren() {
        return children;
    }

    public void setChildren(List<AuthMenuItemDTO> children) {
        this.children = children;
    }

    public List<String> getButtons() {
        return buttons;
    }

    public void setButtons(List<String> buttons) {
        this.buttons = buttons;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String toJson() {
        Gson gson = new Gson();
        return gson.toJson(this);
    }
}
